<?php
namespace app\common\audit\validate;


use think\Validate;

class AuditConfigValidate extends Validate
{
    protected $rule = [
        'id' => ['gt:0'],
        'company_id' => ['gt:0'],
        'timing'  => ['require'],
        'condition' => ['require']
    ];

    protected $message = [
        'id.gt' => '请选择要更新的审核内容',
        'company_id.gt' => '请选择公司',
        'timing.require' => '请选择审核类型',
        'condition.require' => '请设置审核条件'
    ];

    protected $scene = [
        'create' => ['company_id', 'timing'], // 创建
        'edit'  => ['id', 'company_id', 'timing'], // 更新基本信息
        'update' => ['id', 'condition'], // 设置审核流程的时候
        'delete' => ['id']
    ];
}